﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第102题
//BC104 最高身高
//https://www.nowcoder.com/practice/258fe0c567ac493f9b7bc9d3669d158d?tpId=107&tqId=33385&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3Fpage%3D2%26tpId%3D107%26type%3D107&difficulty=undefined&judgeStatus=undefined&tags=&title=

#include <stdio.h>

int main() {
    int n = 0, m = 0;
    scanf("%d %d", &n, &m);
    int arr[10][10] = { 0 };

    //输入
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            scanf("%d", &arr[i][j]);
        }
    }

    //找最大值,并记录下坐标
    int index1 = 0;
    int index2 = 0;
    int max = arr[0][0];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (max < arr[i][j]) {
                max = arr[i][j];
                index1 = i;
                index2 = j;
            }


        }
    }

    printf("%d %d\n", index1 + 1, index2 + 1);
    return 0;
}